type TEvent = () => void;

let event: TEvent | null;

export default () => {
    const QEmit = () => {
        event && event();
    };
    const QOn = (fn: TEvent) => {
        event = fn;
    };
    const QOff = () => (event = null);
    return {
        QEmit,
        QOn,
        QOff
    };
};
